import sqlite3 from 'sqlite3';
const { verbose } = sqlite3;

// 使用 new 调用 verbose()
const db = new (verbose()).Database(':memory:');


db.serialize(() => {
  db.run("CREATE TABLE test (id INT, name TEXT)");
  db.run("INSERT INTO test VALUES (1, 'Alice')");
  db.each("SELECT * FROM test", (err, row) => {
    console.log(row); // 应输出 { id: 1, name: 'Alice' }
  });
});

db.close();
